<template>
  <el-icon>
    <component :is="icon" />
  </el-icon>
</template>

<script setup lang="ts">
import { computed } from 'vue'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const props = defineProps<{
  icon: string
}>()

const icon = computed(() => {
  return ElementPlusIconsVue[props.icon as keyof typeof ElementPlusIconsVue]
})
</script> 